class Solution {
public:
    bool isSymmetrical(TreeNode* pRoot)
    {
        if(pRoot == NULL){
            return true;
        }
        return isSymmetrical(pRoot->left, pRoot->right);
    }
    bool isSymmetrical(TreeNode* left, TreeNode* right){
        if(NULL == left && NULL == right){
            return true;
        }
        if(NULL == left || NULL == right){
            return false;
        }
        if(left->val != right->val){
            return false;
        }
        return isSymmetrical(left->left, right->right) && isSymmetrical(left->right, right->left);
    }
};